package com.chenqi.community.dao;

import com.chenqi.community.entity.Comment;
import org.apache.ibatis.annotations.Param;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Ardai
 */
@Repository
@MapperScan
public interface CommentDao {
    //查询当前文章的评论
    List<Comment> findCommentsByPostId(@Param("pid") Integer pid);

    //添加评论
    void insertComment(Comment comment);

    //查询当前文章的评论个数
    Integer findCommentsCount(@Param("pid") Integer pid);
}
